#!/bin/bash

# 变量定义
app_version=v1.05

# maven打包
mvn clean -Dmaven.test.skip=true package
# 根据Dockerfile文件创建本地镜像
docker build -t springcloudwp/eureka:${app_version} .
# 登录到远程镜像中心
docker login --username=luohoufa@aliyun.com registry.cn-shanghai.aliyuncs.com
# 为本地镜像打tag
docker tag springcloudwp/eureka:${app_version} registry.cn-shanghai.aliyuncs.com/springcloudwp/eureka:${app_version}
# 将本地镜像推送到远程镜像中心
docker push registry.cn-shanghai.aliyuncs.com/springcloudwp/eureka:${app_version}